#!/usr/bin/env python
# $Id: setup.py 96 2012-03-03 13:26:23Z 4glitch $

from setuptools import setup
from setuptools.command.install import install as _install

src_dir = 'src'

class install(_install):
    def run(self):
        import os
        
        root_dir = os.path.dirname(__file__)
        if root_dir != '':
            os.chdir(root_dir)
        
        os.chdir(src_dir)
        # compile i18n messages
        try:
            from django.core import management
            management.call_command('compilemessages')
        except ImportError:
            pass
        finally:
            os.chdir('..')
        
        _install.run(self)

setup(name = 'grdlog',
      version = '0.3.5',
      description = "A tools for aggregating log entries in SQL database",
      author = "Dmitri Bogomolov",
      author_email = '4glitch@gmail.com',
      url = 'http://code.google.com/p/grdlog/',
      
      cmdclass = {'install': install},
      
      packages = ['grdlog',
                  'grdlog.templatetags',
                  'grdlog.sqlpipe',
                  'grdlog.plugins'],
      package_dir = {'grdlog': src_dir},
      
      package_data = {
          '': ['templates/*/*.html',
               'static/css/*.css',
               'sql/*.sql',
               'locale/*/LC_MESSAGES/*.mo']
          },
      data_files = [('/usr/libexec', ['src/sqlpipe/sqlpipe.tac'])],
      install_requires = ['distribute',
                          'twisted',
                          'txpostgres',
                          'twistedschedule'],

      extras_require = {
          'django': ['Django>=1.3', 'django_appsettings']
          },
      
      entry_points = {'grdlog.db':
                      ['adbapi = grdlog.plugins.adbapi:RawDB',
                       'django = grdlog.plugins.django:DjangoDB[django]'],
                      'grdlog.conf':
                      ['django = grdlog.plugins.django:DjangoConf[django]'],
                      'grdlog.source':
                      ['inet = grdlog.plugins.syslog:InetSource',
                       'local = grdlog.plugins.syslog:LocalSource']
                      },
      
      classifiers = ['Development Status :: 3 - Alpha',
                     'Intended Audience :: System Administrators',
                     'License :: OSI Approved :: BSD License'
                     'Programming Language :: Python',
                     'Framework :: Twisted :: Django',
                     'Topic :: System :: Networking :: Monitoring'],
      )
